package com.cib.fintech.entrustedinvestment.biz.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;

/**
 * @website https://el-admin.vip
 * @description /
 * @author zhangqingkun
 * @date 2020-09-17
 **/
@Entity
@Data
@Table(name="t_bok_val")
public class BookValue implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "seq_no")
    @ApiModelProperty(value = "流水号")
    private Integer seqNo;

    @Column(name = "bookset_id")
    @ApiModelProperty(value = "产品代码")
    private String booksetId;

    @Column(name = "bookset_name")
    @ApiModelProperty(value = "产品名称")
    private String booksetName;

    @Column(name = "profit_type")
    @ApiModelProperty(value = "收益类型")
    private String profitType;

    @Column(name = "val_date")
    @ApiModelProperty(value = "估值日期")
    private Timestamp valDate;

    @Column(name = "detail_dist")
    @ApiModelProperty(value = "明细区分")
    private String detailDist;

    @Column(name = "subjet_no")
    @ApiModelProperty(value = "科目号")
    private String subjetNo;

    @Column(name = "subject_name")
    @ApiModelProperty(value = "科目名称")
    private String subjectName;

    @Column(name = "fsubject_id")
    @ApiModelProperty(value = "上级科目号")
    private String fsubjectId;

    @Column(name = "num_amt")
    @ApiModelProperty(value = "数量")
    private BigDecimal numAmt;

    @Column(name = "unit_cost")
    @ApiModelProperty(value = "单位成本")
    private BigDecimal unitCost;

    @Column(name = "cost")
    @ApiModelProperty(value = "cost")
    private BigDecimal cost;

    @Column(name = "cost_percent")
    @ApiModelProperty(value = "本币成本占比")
    private BigDecimal costPercent;

    @Column(name = "market_value")
    @ApiModelProperty(value = "原币市值")
    private BigDecimal marketValue;

    @Column(name = "value_percent")
    @ApiModelProperty(value = "本币市值占比")
    private BigDecimal valuePercent;

    @Column(name = "value_increment")
    @ApiModelProperty(value = "本币市值占比")
    private BigDecimal valueIncrement;

    @Column(name = "bal_flag")
    @ApiModelProperty(value = "balFlag")
    private String balFlag;

    @Column(name = "shadow_price_value")
    @ApiModelProperty(value = "影子价格估值")
    private BigDecimal shadowPriceValue;

    @Column(name = "create_user")
    @ApiModelProperty(value = "创建人")
    private String createUser;

    @Column(name = "create_dept")
    @ApiModelProperty(value = "创建部门")
    private String createDept;

    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    private Timestamp createTime;

    @Column(name = "update_user")
    @ApiModelProperty(value = "更新人")
    private String updateUser;

    @Column(name = "update_time")
    @ApiModelProperty(value = "更新时间")
    private Timestamp updateTime;

    @Column(name = "market_val_date")
    @ApiModelProperty(value = "行情日期")
    private Timestamp marketValDate;

    @Column(name = "layering_id")
    @ApiModelProperty(value = "分层代码")
    private String layeringId;

    @Column(name = "close_price")
    @ApiModelProperty(value = "行情")
    private BigDecimal closePrice;

    public void copy(BookValue source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}